/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import 'package:flutter/cupertino.dart';
import 'pages/function_list.dart';
import 'pages/node_test.dart';
import 'pages/visitor_test.dart';

import 'common/test_model_app.dart';
import 'common/test_route.dart';
import 'pages/builder_test.dart';
import 'pages/entity_test.dart';
import 'pages/examples_test.dart';
import 'pages/exceptions_test.dart';
import 'pages/iterable_test.dart';
import 'pages/mutate_test.dart';
import 'pages/namespace_test.dart';
import 'pages/navigation_test.dart';
import 'pages/parse_test.dart';
import 'pages/query_test.dart';
import 'pages/regression_test.dart';
import 'pages/stream_test.dart';
import 'pages/tutorial_test.dart';
import 'pages/utils_test.dart';

void main() {
  final items = [
    MainItem('functions', "", route: "FunctionList"),

    //SXmlWriterTestPage
    MainItem('visitor_test', "", route: "VisitorTestPage"),
    MainItem('utils_test', "", route: "UtilsTestPage"),
    MainItem('tutorial_test', "", route: "TutorialTestPage"),
    MainItem('stream_test', "", route: "StreamTestPage"),
    MainItem('regression_test', "", route: "RegressionTestPage"),
    MainItem('query_test', "", route: "QueryTestPage"),
    MainItem('parese_test', "", route: "PareseTestPage"),

    MainItem('node_test', "", route: "NodeTestPage"),
    MainItem('navigation_test', "", route: "NavigationTestPage"),

    MainItem('namespace_test', "", route: "NamespaceTestPage"),
    MainItem('mutate_test', "", route: "MutateTestPage"),
    MainItem('itrable_test', "", route: "IterableTestPage"),
    MainItem('exceptions_test', "", route: "ExceptionsTestPage"),
    MainItem('examples_test', "", route: "ExceTestPage"),
    MainItem('entity_test', "", route: "EntityTestPage"),
    MainItem('builder_test', "", route: "BuilderTestPage"),
  ];

  runApp(TestModelApp(
      appName: 'xml',
      data: TestRoute(
        items: items,
        routes: {
          "FunctionList": (context) {
            return FunctionList();
          },

          //SXmlWriterTestPage
          "VisitorTestPage": (context) {
            return VisitorTestPage("VisitorTestPage");
          },
          "UtilsTestPage": (context) {
            return UtilsTestPage("UtilsTestPage");
          },
          "TutorialTestPage": (context) {
            return TutorialTestPage("TutorialTestPage");
          },
          "StreamTestPage": (context) {
            return StreamTestPage("StreamTestPage");
          },
          "RegressionTestPage": (context) {
            return RegressionTestPage("RegressionTestPage");
          },
          "QueryTestPage": (context) {
            return QueryTestPage("QueryTestPage");
          },
          "PareseTestPage": (context) {
            return PareseTestPage(
              "PareseTestPage",
              showSearchIcon: true,
            );
          },
          "NodeTestPage": (context) {
            return NodeTestPage("NodeTestPage");
          },
          "NavigationTestPage": (context) {
            return NavigationTestPage("NavigationTestPage");
          },
          "NamespaceTestPage": (context) {
            return NamespaceTestPage("NamespaceTestPage");
          },
          "MutateTestPage": (context) {
            return MutateTestPage("MutateTestPage");
          },
          "IterableTestPage": (context) {
            return IterableTestPage("IterableTestPage");
          },
          "ExceptionsTestPage": (context) {
            return ExceptionsTestPage("ExceptionsTestPage");
          },
          "ExceTestPage": (context) {
            return ExceTestPage("ExceTestPage");
          },
          "EntityTestPage": (context) {
            return EntityTestPage("EntityTestPage");
          },
          "BuilderTestPage": (context) {
            return BuilderTestPage("BuilderTestPage");
          },
        },
      ))); //BuilderTestPage
}
